<page-bar></page-bar>
<nz-spin [nzSpinning]="userLoading">
  <div class="main" *ngIf="user">
    <div class="left">
      <form nz-form nzLayout="vertical" #f="ngForm" (submit)="save()" se-container="1">
        <se label="账号">
          <input nz-input type="text" [(ngModel)]="user.username" name="username" readonly />
        </se>
        <se label="名称" error="请输入您的名称!">
          <input nz-input [(ngModel)]="user.name" name="name" required />
        </se>
        <se>
          <button nz-button nzType="primary" [disabled]="f.invalid">更新基本信息</button>
        </se>
      </form>
    </div>
    <div class="right">
      <div class="avatar_title">头像</div>
      <div class="avatar"><img [src]="avatar" alt="Avatar" /></div>
      <nz-upload nzAction="/cf/admin/sysfile/upload" [nzBeforeUpload]="beforeUpload" nzAccept=".jpg,.png" nzLimit="1"
        [nzShowUploadList]="false" (nzChange)="handleChange($event)">
        <button nz-button class="button_view">
          <i nz-icon nzType="upload"></i>
          <span>更换头像</span>
        </button>
      </nz-upload>
    </div>
  </div>
</nz-spin>
